package com.yhsimon.realm.member.controller;

import com.yhsimon.realm.member.service.ExperienceService;
import com.yhsimon.realm.member.utils.R;
import com.yhsimon.realm.member.vo.user.UserExpVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/member/exp")
public class ExpController {

    @Autowired
    private ExperienceService experienceService;

    @GetMapping("/getUserExp/{userId}")
    public R getUserExp(@PathVariable String userId) {
        UserExpVo userExpVo=experienceService.getUserExp(Long.parseLong(userId));
        return R.ok().put("data",userExpVo);
    }
}
